<template>
  <div
    style="width: 100%; background: white; padding-left: 250px"
    class="el-scrollbar__wrap"
  >
    <div class="waybill_header">
      <div style="width: 85%">
        <div v-if="origin === 'waybill'">
          <div class="searchWrap">
            <span style="font-size: 14px">开始记录时间 : </span>
            <el-date-picker
              v-model="reportStartTime"
              type="datetime"
              value-format="timestamp"
              placeholder="选择日期时间"
              default-time="12:00:00"
              @focus="minDate = true"
              style="width: 180px"
            >
            </el-date-picker>
          </div>
          <div class="searchWrap">
            <span style="font-size: 14px">结束记录时间 : </span>
            <el-date-picker
              v-model="reportEndTime"
              type="datetime"
              value-format="timestamp"
              placeholder="选择日期时间"
              default-time="12:00:00"
              @focus="maxDate = true"
              style="width: 180px"
            >
            </el-date-picker>
          </div>
          <div class="searchWrap">
            <span style="font-size: 14px">设备号 : </span>
            <el-select
              v-model="deviceValue"
              placeholder="请选择设备号"
              multiple
              collapse-tags
              style="width: 170px"
            >
              <el-option
                :label="item"
                :value="item"
                v-for="(item, index) in deviceList"
                :key="index"
              >
              </el-option>
            </el-select>
          </div>
          <div class="searchWrap">
            <span style="font-size: 14px">数据记录间隔 : </span>
            <el-select
              v-model="time_interval"
              placeholder="数据记录间隔"
              style="width: 180px"
            >
              <el-option
                :label="item.label"
                :value="item.value"
                v-for="(item, index) in durationList"
                :key="index"
              >
              </el-option>
            </el-select>
          </div>
          <div class="searchWrap">
            <span style="font-size: 14px">报告显示维度 : </span>
            <el-select
              v-model="show_time_type"
              placeholder="报告显示维度"
              style="width: 180px"
              @change="changeShowTime"
            >
              <el-option
                :label="item.label"
                :value="item.value"
                v-for="(item, index) in showTimeTypeList"
                :key="index"
              >
              </el-option>
            </el-select>
          </div>
          <div class="searchWrap">
            <el-select
              v-model="formValue"
              placeholder="请选择"
              style="width: 110px"
              @change="changeFormType"
            >
              <el-option label="洲斯" value="洲斯"> </el-option>
              <el-option label="鲁尔" value="鲁尔"> </el-option>
              <el-option label="渡石" value="渡石"> </el-option>
            </el-select>
          </div>
        </div>
        <!-- <div class="searchWrap" v-if="origin === 'order'">
          <span style="font-size: 14px">运单号 : </span>
          <el-select
            v-model="WaybillValue"
            placeholder="请选择"
            style="width: 170px"
          >
            <el-option
              v-for="item in WaybillListData"
              :key="item.WaybillId"
              :label="item.WaybillNo"
              :value="item.WaybillId"
            >
            </el-option>
          </el-select>
        </div> -->

        <div class="searchWrap">
          <el-button @click="searchSubmit" v-if="origin === 'waybill'"
            >查询</el-button
          >
          <el-button type="primary" @click="printTemp">导出报告</el-button>
          <el-button type="primary" @click="sendEmail">发送邮箱</el-button>
          <el-button type="primary" @click="resetTemp" v-if="origin !== 'order'"
            >重置温度报告</el-button
          >
        </div>
      </div>
    </div>
    <div
      class="wrapper"
      style="
        width: 800px;
        min-height: calc(100vh - 105px);
        padding-left: 50px;
        -webkit-print-color-adjust: exact;
      "
      id="printMe"
    >
      <div class="ordersInfo" v-if="formValue !== '洲斯'">
        <h2 style="text-align: center; width: 800px; margin-bottom: 20px">
          西安渡石医药供应链有限公司-温度数据报告
        </h2>
        <div
          style="
            font-size: 16px;
            color: red;
            text-align: center;
            font-weight: bold;
            margin-top: -20px;
            margin-bottom: 20px;
          "
          v-if="formValue === '鲁尔'"
        >
          所有事件基于UTC+8，[YY-MM-DD HH:MM:SS]
        </div>
        <h4
          class="infoTitle"
          style="margin-bottom: 10px; height: 20px"
          v-show="formValue === '渡石'"
        >
          <div
            style="
              float: left;
              width: 380px;
              text-align: center;
              background: #c0c0c0;
            "
          >
            设备信息
          </div>
          <div
            style="
              float: right;
              width: 380px;
              text-align: center;
              background: #c0c0c0;
            "
          >
            设备配置
          </div>
        </h4>
        <h4
          class="infoTitle"
          style="margin-bottom: 10px; height: 20px"
          v-show="formValue === '鲁尔'"
        >
          <div
            style="
              float: left;
              width: 380px;
              border-bottom: 2px solid black;
              height: 28px;
            "
          >
            设备信息
          </div>
          <div
            style="
              float: right;
              width: 380px;
              border-bottom: 2px solid black;
              height: 28px;
            "
          >
            设备配置
          </div>
        </h4>
        <div
          class="infoBody"
          style="display: flex; justify-content: flex-start; flex-wrap: wrap"
        >
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 运单编号：{{ selectedCode }} -->
            公司名称：西安渡石医药供应链有限公司
          </div>
          <!-- <div
          class="infoItem"
          style="width: 500px; font-size: 14px; height: 30px; line-height: 30px"
        >
          时间范围：{{
            new Date(Number(timeRange[0])).toLocaleString()
          }}&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;{{
            new Date(Number(timeRange[1])).toLocaleString()
          }}
        </div> -->
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 发运方：{{ customer_company }} -->
            数据记录间隔：{{ newInfo.recording_interval }}
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 收货方：{{ receiver_company }} -->
            设备型号：{{ newInfo.device_type }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 运输方式：{{ delivery_method }} -->
            记录总时长：{{ newInfo.record_times }}
          </div>
          <div
            class="infoItem"
            style="width: 420px; font-size: 14px; line-height: 30px"
          >
            <!-- 记录间隔：{{ interval_time }}分钟 -->
            <i style="float: left">设备号：</i>
            <div style="float: right; width: 360px">
              <span
                v-for="(item, index) in newInfo.device_no
                  ? newInfo.device_no.split(',')
                  : ''"
                :key="index"
                style="
                  display: inline-block;
                  word-break: break-all;
                  float: left;
                  margin-right: 10px;
                "
                >{{ item }}</span
              >
            </div>
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 最高温度：{{ temperature_uplimit }} -->
            记录模式：多次记录
          </div>
          <h4
            class="infoTitle"
            style="margin-bottom: 10px; height: 20px"
            v-show="formValue === '渡石'"
          >
            <div
              style="
                float: left;
                text-align: center;
                background: #c0c0c0;
                width: 800px;
              "
            >
              记录数据概要
            </div>
          </h4>
          <h4
            class="infoTitle"
            style="margin-bottom: 10px; height: 20px"
            v-show="formValue === '鲁尔'"
          >
            <div
              style="
                float: left;
                width: 800px;
                border-bottom: 2px solid black;
                height: 28px;
              "
            >
              记录数据概要
            </div>
          </h4>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 最低温度：{{ temperature_lowlimit }} -->
            开始记录时间：{{
              newInfo.start_time | afterTime(newInfo.start_time)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 启运时间：{{
              new Date(Number(startTime) * 1000)
                .toLocaleString()
                .replace(/:\d{1,2}$/, " ")
            }} -->
            结束记录时间：{{ newInfo.end_time | afterTime(newInfo.end_time) }}
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 签收时间：{{
              new Date(Number(endTime) * 1000)
                .toLocaleString()
                .replace(/:\d{1,2}$/, " ")
            }} -->
            本次运输中发生的最高温度：{{ newInfo.max_temperature }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            最低温度时间点：{{
              newInfo.min_temperature_date
                | afterTime(newInfo.min_temperature_date)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 启运温度：{{ startTemp }} -->
            本次运输中发生的最低温度：{{ newInfo.min_temperature }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            最高温度时间点：{{
              newInfo.max_temperature_date
                | afterTime(newInfo.max_temperature_date)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 签收温度：{{ endTemp }} -->
            低温阀值：{{ newInfo.min_temperature_threshold }}℃
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            高温阀值：{{ newInfo.max_temperature_threshold }}℃
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            <!-- 温度范围：{{ tempRange }} -->
            低温超限总时长：
            <!-- {{
              newInfo.below_min_threshold_times
                | afterTime(newInfo.below_min_threshold_times)
            }} -->
            {{ newInfo.below_min_threshold_times }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            高温超限总时长：{{ newInfo.over_max_threshold_times }}
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            低温超限次数：{{
              newInfo.below_min_threshold_cnt
                | manyTime(newInfo.below_min_threshold_cnt)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            高温超限次数：{{
              newInfo.over_max_threshold_cnt
                | manyTime(newInfo.over_max_threshold_cnt)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            平均温度：{{ newInfo.avg }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 14px;
              height: 30px;
              line-height: 30px;
            "
          >
            记录数据总条数：{{ newInfo.record_total_cnt }}
          </div>
        </div>
      </div>
      <div class="ordersInfo" v-else>
        <!-- <h4 style="position: relative">ZKS Cloud</h4> -->
        <h2 style="text-align: center; width: 800px; margin-bottom: 20px">
          数据报告
        </h2>
        <div
          class="infoBody"
          style="display: flex; justify-content: flex-start; flex-wrap: wrap"
        >
          <h3 class="infoTitle" style="margin-bottom: 10px; height: 20px">
            <div
              style="
                float: left;
                width: 800px;
                border-bottom: 2px solid black;
                height: 28px;
              "
            >
              报告信息
            </div>
          </h3>
          <div
            class="infoItem"
            style="
              width: 420px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            报告编号：BoxDataReport{{ newInfo.device_no }}{{ Date.now() }}
          </div>
          <h3 class="infoTitle" style="margin-bottom: 10px; height: 20px">
            <div
              style="
                float: left;
                width: 800px;
                border-bottom: 2px solid black;
                height: 28px;
              "
            >
              设备信息
            </div>
          </h3>
          <div
            class="infoItem"
            style="
              width: 750px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            公司名称：西安渡石医药供应链有限公司
          </div>
          <div
            class="infoItem"
            style="width: 750px; font-size: 12px; line-height: 30px"
          >
            <i style="float: left">设备编号：{{ newInfo.device_no }}</i>
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            采集间隔：{{ newInfo.recording_interval }}
          </div>
          <div
            class="infoItem"
            style="
              width: 500px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            上传间隔：{{ newInfo.recording_interval }}
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            开始时间：{{ newInfo.start_time | afterTime(newInfo.start_time) }}
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            结束时间：{{ newInfo.end_time | afterTime(newInfo.end_time) }}
          </div>

          <h3 class="infoTitle" style="margin-bottom: 10px; height: 20px">
            <div
              style="
                float: left;
                width: 800px;
                border-bottom: 2px solid black;
                height: 28px;
              "
            >
              记录结果
            </div>
          </h3>

          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            最高温度：{{ newInfo.max_temperature }}@{{
              newInfo.min_temperature_date
                | afterTime(newInfo.max_temperature_date)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            最低温度：{{ newInfo.min_temperature }}@{{
              newInfo.max_temperature_date
                | afterTime(newInfo.min_temperature_date)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            "
          >
            平均温度：{{ newInfo.avg }}
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            测点名称：{{
              newInfo.device_no +
              "003" +
              "（" +
              newInfo.device_no +
              "003" +
              "）"
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 250px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            记录总点数：{{ newInfo.record_total_cnt }}
          </div>
          <div
            class="infoItem"
            style="
              width: 300px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            总时长：{{ newInfo.record_times }}
          </div>

          <h3 class="infoTitle" style="margin-bottom: 10px; height: 20px">
            <div
              style="
                float: left;
                width: 800px;
                border-bottom: 2px solid black;
                height: 28px;
              "
            >
              报警信息
            </div>
          </h3>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            报警区域
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            报警延时(类型)
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            总计超限时间
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            超限事件数
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            首次触发时间
          </div>
          <div
            class="infoItem"
            style="
              width: 100px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            状态
          </div>
          <!-- 表格第一排 -->
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            温度 > {{ newInfo.max_temperature_threshold }}℃
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            0s(单一类型)
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            {{ newInfo.over_max_threshold_times || 0 }}
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            {{
              newInfo.over_max_threshold_cnt
                | manyTime(newInfo.over_max_threshold_cnt)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          ></div>
          <div
            class="infoItem"
            style="
              width: 100px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            正常
          </div>
          <!-- 表格第二排 -->
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            温度 &lt; {{ newInfo.min_temperature_threshold }}℃
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            0s(单一类型)
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            {{ newInfo.over_min_threshold_times || 0 }}
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            {{
              newInfo.below_min_threshold_cnt
                | manyTime(newInfo.below_min_threshold_cnt)
            }}
          </div>
          <div
            class="infoItem"
            style="
              width: 140px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          ></div>
          <div
            class="infoItem"
            style="
              width: 100px;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
              margin-bottom: 10px;
            "
          >
            正常
          </div>

          <h3 class="infoTitle" style="margin-bottom: 10px; height: 20px">
            <div
              style="
                float: left;
                width: 800px;
                border-bottom: 2px solid black;
                height: 28px;
              "
            >
              数据曲线
            </div>
          </h3>
        </div>
      </div>
      <div>
        <div
          ref="chart"
          class="echarts"
          style="margin-top: 70px; width: 750px; height: 700px"
        ></div>
      </div>
      <!-- <div class="tempTable" v-if="formValue !== '渡石' && tempTable2.length">
        <h4 style="margin-bottom: 20px">温度数据</h4>
        <table
          style="font-size: 12px; text-align: center; border-collapse: collapse"
        >
          <tbody>
            <tr style="width: 100%; display: flex; flex-wrap: wrap">
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                  padding: 0 10px;
                "
                v-for="(item, index) in tempTable2"
                :key="index"
              >
                {{ item.time }}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.temp }}
              </td>
            </tr>
          </tbody>
        </table>
      </div> -->
      <div class="tempTable" v-if="tempTable2.length">
        <h4 style="margin-bottom: 20px">温度数据</h4>
        <div style="width: 805px; overflow: hidden">
          <table
            style="
              font-size: 10px;
              text-align: center;
              border-collapse: collapse;
              float: left;
              margin-left: 5px;
            "
            v-if="tempTable2_1.length !== 0"
          >
            <thead>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showDeviceNo"
              >
                温度计编号
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                记录时间
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                t1
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showT2"
              >
                t2
              </td>
            </thead>
            <tbody>
              <tr v-for="(temp1, index) in tempTable2_1" :key="index">
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showDeviceNo"
                >
                  {{ temp1.device_no }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{
                    new Date(Number(temp1.collect_time) * 1000).toLocaleString()
                  }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{ temp1.t1 }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showT2"
                >
                  {{ temp1.t2 }}
                </td>
              </tr>
            </tbody>
          </table>
          <table
            style="
              font-size: 10px;
              text-align: center;
              border-collapse: collapse;
              float: left;
              margin-left: 5px;
            "
            v-if="tempTable2_2.length !== 0"
          >
            <thead>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showDeviceNo"
              >
                温度计编号
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                记录时间
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                t1
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showT2"
              >
                t2
              </td>
            </thead>
            <tbody>
              <tr v-for="(temp1, index) in tempTable2_2" :key="index">
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showDeviceNo"
                >
                  {{ temp1.device_no }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{
                    new Date(Number(temp1.collect_time) * 1000).toLocaleString()
                  }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{ temp1.t1 }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showT2"
                >
                  {{ temp1.t2 }}
                </td>
              </tr>
            </tbody>
          </table>
          <table
            style="
              font-size: 10px;
              text-align: center;
              border-collapse: collapse;
              float: left;
              margin-left: 5px;
            "
            v-if="tempTable2_3.length !== 0"
          >
            <thead>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showDeviceNo"
              >
                温度计编号
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                记录时间
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                t1
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showT2"
              >
                t2
              </td>
            </thead>
            <tbody>
              <tr v-for="(temp1, index) in tempTable2_3" :key="index">
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showDeviceNo"
                >
                  {{ temp1.device_no }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{
                    new Date(Number(temp1.collect_time) * 1000).toLocaleString()
                  }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{ temp1.t1 }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showT2"
                >
                  {{ temp1.t2 }}
                </td>
              </tr>
            </tbody>
          </table>
          <table
            style="
              font-size: 10px;
              text-align: center;
              border-collapse: collapse;
              float: left;
              margin-left: 5px;
            "
            v-if="tempTable2_4.length !== 0"
          >
            <thead>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showDeviceNo"
              >
                温度计编号
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                记录时间
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                t1
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showT2"
              >
                t2
              </td>
            </thead>
            <tbody>
              <tr v-for="(temp1, index) in tempTable2_4" :key="index">
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showDeviceNo"
                >
                  {{ temp1.device_no }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{
                    new Date(Number(temp1.collect_time) * 1000).toLocaleString()
                  }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{ temp1.t1 }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showT2"
                >
                  {{ temp1.t2 }}
                </td>
              </tr>
            </tbody>
          </table>
          <table
            v-if="!showDeviceNo || tempTable2_5.length !== 0"
            style="
              font-size: 10px;
              text-align: center;
              border-collapse: collapse;
              float: left;
              margin-left: 5px;
            "
          >
            <thead>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showDeviceNo"
              >
                温度计编号
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                记录时间
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
              >
                t1
              </td>
              <td
                style="
                  border: 1px solid #ebeef5;
                  height: 29.4px;
                  line-height: 29.5px;
                "
                v-if="showT2"
              >
                t2
              </td>
            </thead>
            <tbody>
              <tr v-for="(temp1, index) in tempTable2_5" :key="index">
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showDeviceNo"
                >
                  {{ temp1.device_no }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{
                    new Date(Number(temp1.collect_time) * 1000).toLocaleString()
                  }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                >
                  {{ temp1.t1 }}
                </td>
                <td
                  style="
                    border: 1px solid #ebeef5;
                    height: 29.4px;
                    line-height: 29.5px;
                    padding: 0 5px;
                  "
                  v-if="showT2"
                >
                  {{ temp1.t2 }}
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import {
  reqWaybillTemp,
  reqTempInterval,
  reqSendEmail,
  reqResetTemp,
} from "@/api/waybill";
import { detailWaybillList } from "@/api/orderForm";
import "echarts/lib/component/markPoint"; //引入提示气泡
import moment from "moment";
import print from "print-js";

export default {
  name: "temperatureData",
  components: {},
  props: ["id", "origin"],
  data() {
    return {
      showT2: true,
      minDate: "",
      maxDate: "",
      // timeOption1: {
      //   disabledDate: (time) => {
      //     if (this.minDate) {
      //       return (
      //         time <= (this.newInfo.start_time - 86400) * 1000 ||
      //         time >= this.newInfo.end_time * 1000
      //       );
      //     }
      //     return false;
      //   },
      // },
      // timeOption2: {
      //   disabledDate: (time) => {
      //     if (this.maxDate) {
      //       return (
      //         time <= (this.newInfo.start_time - 86400) * 1000 ||
      //         time >= this.newInfo.end_time * 1000
      //       );
      //     }
      //     return false;
      //   },
      // },
      reportStartTime: "",
      reportEndTime: "",
      time_interval: "5",
      deviceValue: [], //选择的设备
      deviceList: [], //温度计列表
      durationList: [
        { label: "1分钟", value: "1" },
        { label: "5分钟", value: "5" },
        { label: "10分钟", value: "10" },
      ],
      show_time_type: "system",
      showTimeTypeList: [
        { label: "温度计R标识", value: "device_state" },
        { label: "系统绑定时间", value: "system" },
      ],
      formValue: "渡石",
      display: true,
      selectedCode: "", //运单号
      customer_company: "", //发运方
      receiver_company: "", //收货方
      delivery_method: "", //运输方式
      temperature_uplimit: "",
      temperature_lowlimit: "",
      startTime: "",
      endTime: "",
      startTemp: "",
      endTemp: "",
      tempRange: "",
      interval_time: "", //记录间隔
      newInfo: {},
      tempTable: [], //返回的未处理的温度信息
      tempTable2: [], //表格数据
      tempTable2_1: [], //表格数据奇数项
      tempTable2_2: [], //表格数据偶数项
      tempTable2_3: [],
      tempTable2_4: [],
      tempTable2_5: [],
      device_noTempList: [], //目前选择的设备号下面的温度数据
      showDeviceNo: true,
      echartsOptions: {
        //echarts的配置项
        title: {
          show: true,
          // text: "温度变化折线图", //主标题
          textAlign: "center",
          left: 200,
          fontSize: 12,
          fontWeight: "normal",
        },
        color: [
          "#37A3DC",
          "#B8E986",
          "#FFA080",
          "#71FFA9",
          "#68E1E3",
          "#FFD747",
          "#E162AF",
          "#A487FF",
        ], //修改legend的颜色
        legend: {
          //多条线用标注
          data: [],
          padding: [0, 0, 0, 100],
        },
        xAxis: {
          show: true,
          boundaryGap: false,
          position: "bottom",
          data: [],
          axisLabel: {
            //每个数据都加单位
            formatter: function (data) {
              var text = data;
              return new Date(Number(text) * 1000)
                .toLocaleString()
                .replace(/:\d{1,2}$/, " ");
            },
            // showMaxLabel: true,
          },
        },
        yAxis: {
          show: true,
          type: "value", //为了匹配上命名规则
          axisLine: {
            //坐标轴线
            show: true,
          },
          axisTick: {
            //坐标轴刻度
            show: true,
          },
          axisLabel: {
            //每个数据都加单位
            formatter: "{value}℃",
          },
        },
        series: [],
        grid: {
          left: 50,
          top: 50,
          bottom: 50,
          right: 50,
          height: "65%", // 高度
        },
      },
      // 运单编号列表
      WaybillListData: [],
      WaybillValue: "", //选择
      resultData: {}, //存一份数据
    };
  },
  computed: {},
  created() {},
  mounted() {
    this.getTempData();
  },
  filters: {
    afterTime(value) {
      if (
        value == "Invalid Date" ||
        value == "" ||
        value == 0 ||
        value == undefined
      ) {
        return "";
      } else {
        var time_data = new Date(Number(value) * 1000)
          .toLocaleString()
          .replace(/:\d{1,2}$/, " ");
        return time_data;
      }
    },
    manyTime(value) {
      if (value == "Invalid Date" || value == "" || value == undefined) {
        return "";
      } else {
        return value + "次";
      }
    },
  },
  methods: {
    async printTemp() {
      if (this.deviceValue.length === 0) {
        this.$message.error("请选择设备号");
        return;
      }
      if (this.origin === "order") {
        this.printLines();
      } else {
        let res = await reqTempInterval({
          interval_time: this.time_interval,
          device_nos: this.deviceValue,
          waybill_id: this.id,
        });
        if (res.code !== 10000) {
          this.$confirm(res.message, "提示", {
            confirmButtonText: "继续导出",
            cancelButtonText: "取消",
            type: "warning",
          })
            .then(() => {
              this.printLines();
              this.$message({
                type: "success",
                message: "导出成功!",
              });
            })
            .catch(() => {
              this.$message({
                type: "info",
                message: "已取消导出",
              });
            });
        } else {
          this.printLines();
        }
      }
    },
    printLines() {
      const style = "@page {margin:10mm;};"; //可选-打印时去掉眉页眉尾
      print({
        printable: "printMe", // 标签元素id
        type: "html",
        // documentTitle: "Document",
        header: "",
        targetStyles: ["*"],
        style,
        scanStyles: false, //printjs打印样式出错加这个
      });
    },
    async getTempData() {
      let result;
      if (this.origin === "order") {
        this.waybillListpage();
      } else {
        // console.log(this.origin, 11111111111);
        if (this.deviceValue[0] === "") this.deviceValue = [];
        result = await reqWaybillTemp({
          report_id: "",
          order_id: "",
          waybill_id: this.id,
          type: "temperature",
          device_nos: this.deviceValue,
          time_interval: this.time_interval,
          start_time: (this.reportStartTime + "").slice(0, 10),
          end_time: (this.reportEndTime + "").slice(0, 10),
          show_time_type: this.show_time_type,
          source_type: this.origin == "order" ? "order" : "",
        });
        this.resultData = result;
        if (result.data.data === null) return;
        this.showT2 = this.resultData.data.data.data_show.some(
          (item) => item.t2 !== ""
        );
        //newInfo.device_no.split(',')是所有的设备号,默认显示第一个设备
        this.deviceList = [...this.resultData.data.data.device_no.split(",")];
        this.deviceValue = [...result.data.data.device_no.split(",")];
        this.waybillListtem(result);
      }
    },
    waybillListtem(result) {
      this.tempTable = result.data.data.data_show; //图表数据，待处理
      this.newInfo = result.data.data;
      this.showDeviceNo = this.newInfo.device_no.split(",").length > 1;
      console.log(this.showDeviceNo, " this.showDeviceNo this.showDeviceNo");
      this.reportStartTime = this.newInfo.start_time * 1000;
      this.reportEndTime = this.newInfo.end_time * 1000;
      if (this.tempTable !== null) {
        //筛选出来指定device_no下面的温度
        if (true) {
          // console.log("渡石");
          this.tempTable.forEach((item) => {
            if (this.newInfo.device_no.split(",").includes(item.device_no)) {
              this.device_noTempList[`${item.device_no}`] = [];
            }
          });
          this.tempTable.forEach((item) => {
            if (this.newInfo.device_no.split(",").includes(item.device_no)) {
              this.device_noTempList[`${item.device_no}`].push(item);
            }
          });

          let series = []; //有几个温度数据就有几个配置对象
          this.newInfo.device_no.split(",").forEach((item, index) => {
            for (
              var i = 0;
              i < this.device_noTempList[item][0].count_num;
              i++
            ) {
              //设备号的数量*温度计的数量
              let tempY = []; //折线图y轴系列数据
              this.device_noTempList[item].forEach((pieceInfo) => {
                pieceInfo[`t${i + 1}`] = (
                  pieceInfo[`t${i + 1}`].replace("℃", "") * 1
                ).toFixed(1);
                tempY.push(pieceInfo[`t${i + 1}`]);
              });
              console.log(tempY, "tempY");
              //准备每根线的标注
              this.echartsOptions.legend.data.push(`${item}-t${i + 1}`);
              series.push({
                type: "line",
                name: `${item}-t${i + 1}`, //为了匹配上legend的标注
                // xAxisIndex: index,
                data: tempY,
                connectNulls: true,
                symbolSize: 0,
                // markPoint: {
                //   //提示最大最小值
                //   symbolSize: 40, //提示气泡的大小
                //   itemStyle: {
                //     //提示气泡的样式
                //     normal: {
                //       color: this.echartsOptions.color[index + i],
                //     },
                //   },
                //   data: [
                //     { type: "max", name: "最大值" },
                //     { type: "min", name: "最小值" },
                //   ],
                //   color: this.echartsOptions.color[i],
                // },
              });
            }
          });

          //准备x轴的数据
          let collect_time_list = this.device_noTempList[
            this.newInfo.device_no.split(",")[0]
          ].map((item) => item.collect_time);
          let newArr = [...new Set(collect_time_list)]; //数组去重
          // setTimeout(() => {
          this.echartsOptions.xAxis.data = newArr;
          this.echartsOptions.series = series; // 数据设置
          this.chart = this.$echarts.init(this.$refs.chart);
          this.chart.setOption(this.echartsOptions, true); //多加一个参数true解决图表频繁切换显示重叠的问题
          // }, 1000);

          //准备表格的数据
          this.tempTable2 = [];
          this.tempTable2_1 = [];
          this.tempTable2_2 = [];
          this.tempTable2_3 = [];
          this.tempTable2_4 = [];
          this.tempTable2_5 = [];
          this.newInfo.device_no.split(",").forEach((item, index) => {
            this.tempTable2.push(...this.device_noTempList[item]);
          });
          if (this.showDeviceNo) {
            //四列
            this.tempTable2.forEach((item, index) => {
              if (index % 4 === 3) {
                //第四列
                this.tempTable2_4.push(item);
              } else if (index % 4 === 2) {
                //第三列
                this.tempTable2_3.push(item);
              } else if (index % 4 === 1) {
                //第二列
                this.tempTable2_2.push(item);
              } else {
                //第一列
                this.tempTable2_1.push(item);
              }
            });
          } else {
            this.tempTable2.forEach((item, index) => {
              if (index % 5 === 4) {
                //第五列
                this.tempTable2_5.push(item);
              } else if (index % 5 === 3) {
                //第四列
                this.tempTable2_4.push(item);
              } else if (index % 5 === 2) {
                //第三列
                this.tempTable2_3.push(item);
              } else if (index % 5 === 1) {
                //第二列
                this.tempTable2_2.push(item);
              } else {
                //第一列
                this.tempTable2_1.push(item);
              }
            });
          }

          console.log(
            this.tempTable2,
            this.tempTable2_1.length,
            this.tempTable2_2.length,
            this.tempTable2_3.length,
            this.tempTable2_4.length,
            this.tempTable2_5.length,
            "this..length"
          );
        } else {
          this.tempTable2 = [];
          let arr1 = []; //有哪些非空的t属性
          for (let key in this.tempTable[0]) {
            if (new RegExp("^t.*$").test(key)) {
              if (this.tempTable[0][key] !== null) {
                arr1.push(key);
              }
            }
          }
          // console.log(arr1, "arr1");
          let series = []; //有几个温度数据就有几个配置对象
          let timeX = []; //折线图x轴
          let tempY = {}; //折线图y轴
          for (var i = 0; i < arr1.length; i++) {
            let arr3 = [];
            this.tempTable.forEach((item) => {
              if (item.device_no === this.newInfo.device_no.split(",")[0]) {
                if (item[arr1[i]]) {
                  arr3.push((item[arr1[i]].replace("℃", "") * 1).toFixed(1));
                } else {
                  arr3.push("");
                }
              }
            });
            // console.log(arr3, "arr3");
            this.$set(tempY, `t${i + 1}`, arr3);
            // console.log(tempY, "tempY");
            this.echartsOptions.legend.data.push(`t${i + 1}`);
            series.push({
              type: "line",
              name: `t${i + 1}`, //为了匹配上legend的标注
              data: tempY[`t${i + 1}`],
              symbolSize: 0,
              // markPoint: {
              //   //提示最大最小值
              //   symbolSize: 40, //提示气泡的大小
              //   itemStyle: {
              //     //提示气泡的样式
              //     normal: {
              //       color: this.echartsOptions.color[i],
              //     },
              //   },
              //   data: [
              //     { type: "max", name: "最大值" },
              //     { type: "min", name: "最小值" },
              //   ],
              //   color: this.echartsOptions.color[i],
              // },
            });
          }
          this.tempTable.forEach((item) => {
            if (item.device_no === this.newInfo.device_no.split(",")[0]) {
              timeX.push(item.collect_time);
            }
          });
          this.echartsOptions.xAxis.data = timeX; // 横坐标设置
          this.echartsOptions.series = series; // 数据设置
          this.chart = this.$echarts.init(this.$refs.chart);

          this.chart.setOption(this.echartsOptions, true);
          for (let i = 0; i < this.tempTable.length; i++) {
            if (
              this.tempTable[i].device_no ===
              this.newInfo.device_no.split(",")[0]
            ) {
              let str = "";
              for (var j = 0; j < arr1.length; j++) {
                str += tempY[`t${j + 1}`][i] + " ";
                console.log(str, "str");
              }
              if (str.indexOf("undefined") === -1) {
                this.tempTable2.push({
                  time: new Date(Number(timeX[i]) * 1000).toLocaleString(),
                  temp: str,
                });
              }
            }
          }
          // console.log(this.tempTable2, "this.tempTable2");
        }
      } else {
        // console.log("没有温度数据----------");
        this.tempTable2 = [];
        this.tempTable2_1 = [];
        this.tempTable2_2 = [];
      }
    },
    async WaybillNode(id) {
      var result = await reqWaybillTemp({
        report_id: "",
        order_id: "",
        waybill_id: id,
        type: "temperature",
        source_type: this.origin == "order" ? "order" : "",
      });
      this.resultData = result;
      if (result.data.data === null) return;
      //newInfo.device_no.split(',')是所有的设备号,默认显示第一个设备
      this.showT2 = this.resultData.data.data.data_show.some(
        (item) => item.t2 !== ""
      );
      this.deviceList = [...this.resultData.data.data.device_no.split(",")];
      this.deviceValue = [...result.data.data.device_no.split(",")];
      if (this.deviceValue[0] === "") this.deviceValue = [];
      this.waybillListtem(result);
    },
    // 调用运单号的接口
    waybillListpage() {
      var param = {
        id: this.id,
      };
      detailWaybillList(param).then((res) => {
        if (res.code == "10000") {
          var res = res.data;
          if (res != null) {
            this.WaybillListData = res;
            this.WaybillValue = res[0];
            this.WaybillNode(this.WaybillValue.WaybillId);
          }
        }
      });
    },
    WaybillSelectChanged(value) {
      this.device_noTempList = [];
      this.tempTable2 = [];
      // 选中后将数据赋值給
      this.WaybillNode(value);
    },
    async filterDevice() {
      let result;
      if (this.deviceValue[0] === "") this.deviceValue = [];
      result = await reqWaybillTemp({
        report_id: "",
        order_id: "",
        waybill_id:
          this.origin === "order" ? this.WaybillValue.WaybillId : this.id,
        type: "temperature",
        device_nos: this.deviceValue,
        time_interval: this.time_interval,
        start_time: (this.reportStartTime + "").slice(0, 10),
        end_time: (this.reportEndTime + "").slice(0, 10),
        show_time_type: this.show_time_type,
        source_type: this.origin == "order" ? "order" : "",
      });
      // if (result.data === null) {
      //   this.newInfo = {};
      //   this.tempTable2 = [];
      //   return;
      // }
      this.resultData = result;
      if (result.data.data === null) {
        this.resetReport();
      } else {
        this.showT2 = this.resultData.data.data.data_show.some(
          (item) => item.t2 !== ""
        );
        //newInfo.device_no.split(',')是所有的设备号,默认显示第一个设备
        this.deviceValue = [...result.data.data.device_no.split(",")];
        this.waybillListtem(result);
      }
    },
    resetReport() {
      this.deviceValue = [];
      this.time_interval = "5";
      this.reportStartTime = "";
      this.reportEndTime = "";
      this.show_time_type = "system";
      this.newInfo = "";
      this.tempTable = null;
      this.tempTable2 = [];
    },
    searchSubmit() {
      // this.WaybillSelectChanged();
      this.filterDevice();
      // this.display = !this.display;
    },
    changeShowTime() {
      this.deviceValue = [];
    },
    changeFormType() {
      this.deviceValue = this.deviceValue.slice(0, 1);
      this.filterDevice();
    },
    sendEmail() {
      this.$prompt("请输入邮箱", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        inputPattern:
          /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
        inputErrorMessage: "邮箱格式不正确",
      })
        .then(async ({ value }) => {
          let loadingInstance = this.$loading();
          let result = await reqSendEmail({
            waybill_id:
              this.origin === "order" ? this.WaybillValue.WaybillId : this.id,
            device_nos: this.deviceValue,
            start_time: (this.reportStartTime + "").slice(0, 10),
            end_time: (this.reportEndTime + "").slice(0, 10),
            receiver_email: value,
          });
          if (result.code === 10000) {
            this.$nextTick(() => {
              // 以服务的方式调用的 Loading 需要异步关闭
              loadingInstance.close();
            });
            this.$message({
              type: "success",
              message: "发送成功",
            });
          } else {
            this.$nextTick(() => {
              // 以服务的方式调用的 Loading 需要异步关闭
              loadingInstance.close();
            });
            this.$message({
              type: "error",
              message: result.message,
            });
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "取消输入",
          });
        });
    },
    async resetTemp() {
      let result = await reqResetTemp({
        waybill_id:
          this.origin === "order" ? this.WaybillValue.WaybillId : this.id,
        device_nos: this.deviceValue,
        start_time: (this.reportStartTime + "").slice(0, 10),
        end_time: (this.reportEndTime + "").slice(0, 10),
      });
      if (result.code === 10000) {
        this.resetReport();
        this.getTempData();
        this.$message({
          type: "success",
          message: "重置成功",
        });
      } else {
        this.$message({
          type: "error",
          message: result.message,
        });
      }
    },
  },
};
</script>
<style lang="scss" scoped>
@media print {
  body {
    -webkit-print-color-adjust: exact;
  }
}

.el-scrollbar__wrap {
  overflow: scroll;
  height: 100%;
}

.waybill_header {
  width: 80%;
  display: flex;
  justify-content: space-between;
}
.tempTable {
  padding-bottom: 70px;
}
.searchWrap {
  display: inline-block;
  margin-right: 20px;
  margin-bottom: 20px;
}
</style>